<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>{{list.length}}</strong></span>
    <ul class="filters" @click="changeBtn">
      <li>
        <a @click="flagTag='all'" :class="{selected:flagTag==='all'}" href="javascript:;" >全部</a>
      </li>
      <li>
        <a @click="flagTag='yes'" :class="{selected:flagTag==='yes'}" href="javascript:;" >未完成</a>
      </li>
      <li>
        <a @click="flagTag='no'" :class="{selected:flagTag==='no'}" href="javascript:;" >已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="clearBtn">清除已完成</button>
  </footer>
</template>

<script>
export default {
    props:['list'],
    data(){
        return{
            flagTag:'all'
        }
    },
    methods: {
        changeBtn(){
            this.$emit('changeTack',this.flagTag)
        },
        clearBtn(){
           this.$emit('delTack')
        }
    }
   
}
</script>